Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web-resource-inliner

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-resource-inliner

Inlines img, script and link tags into the same file.

  • 6.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
984K
increased by5.32%
Maintainers
1
Weekly downloads
 
Created

What is web-resource-inliner?

The web-resource-inliner npm package is used to inline external resources such as CSS, JavaScript, and images into HTML files. This can be useful for reducing the number of HTTP requests and improving page load times.

What are web-resource-inliner's main functionalities?

Inline CSS

This feature allows you to inline external CSS files into the HTML file. The provided code sample demonstrates how to inline a CSS file referenced in an HTML file.

const inliner = require('web-resource-inliner');
const html = '<html><head><link rel="stylesheet" href="styles.css"></head><body></body></html>';
inliner.html({ fileContent: html }, (err, result) => {
  if (err) throw err;
  console.log(result);
});

Inline JavaScript

This feature allows you to inline external JavaScript files into the HTML file. The provided code sample demonstrates how to inline a JavaScript file referenced in an HTML file.

const inliner = require('web-resource-inliner');
const html = '<html><head><script src="script.js"></script></head><body></body></html>';
inliner.html({ fileContent: html }, (err, result) => {
  if (err) throw err;
  console.log(result);
});

Inline Images

This feature allows you to inline external image files into the HTML file. The provided code sample demonstrates how to inline an image file referenced in an HTML file.

const inliner = require('web-resource-inliner');
const html = '<html><body><img src="image.png"></body></html>';
inliner.html({ fileContent: html }, (err, result) => {
  if (err) throw err;
  console.log(result);
});

Other packages similar to web-resource-inliner

Keywords

FAQs

Package last updated on 09 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc